# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# Credits AUR
# Maintainer: redponike <proton (dot) me>
# Contributor: acxz <akashpatel2008 at yahoo dot com>

pkgname=python-dm-tree
_pkgname=${pkgname#python-}
pkgver=0.1.9
pkgrel=1
pkgdesc='Library for working with nested data structures.'
arch=('x86_64' 'aarch64')
url='https://github.com/google-deepmind/tree'
license=('Apache-2.0')
depends=('python' 'python-six' 'abseil-cpp' 'python-absl' 'python-attrs'
         'python-numpy' 'python-wrapt')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'cmake')
source=("https://github.com/google-deepmind/tree/archive/refs/tags/$pkgver.tar.gz")
sha512sums=('1b1fb5a259345874fa666159aa40e15559bc13c140f6f709b4e2bf967d4015f260e6b3f16e91c580f6db15f457c52d9fde28ac50d3133f95f558ef64b2986dce')

prepare() {
  cd "tree-$pkgver"

  sed -i '/cmake_args = \[/a \        "-DCMAKE_POLICY_VERSION_MINIMUM=3.5",' \
    setup.py
}

build() {
  cd "tree-$pkgver"

  python -m build --wheel --no-isolation
}

package() {
  cd "tree-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl
}

